package com.dt.system.service.impl;

import java.util.List;
import com.dt.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.dt.system.mapper.ModRepositoriesShelvesMapper;
import com.dt.system.domain.ModRepositoriesShelves;
import com.dt.system.service.IModRepositoriesShelvesService;

@Service
public class ModRepositoriesShelvesServiceImpl implements IModRepositoriesShelvesService 
{
    @Autowired
    private ModRepositoriesShelvesMapper modRepositoriesShelvesMapper;

    /**
     * 查询
     * 
     * @param id 主键
     * @return
     */
    @Override
    public ModRepositoriesShelves selectModRepositoriesShelvesById(Long id)
    {
        return modRepositoriesShelvesMapper.selectModRepositoriesShelvesById(id);
    }

    /**
     * 查询列表
     * 
     * @param modRepositoriesShelves
     * @return
     */
    @Override
    public List<ModRepositoriesShelves> selectModRepositoriesShelvesList(ModRepositoriesShelves modRepositoriesShelves)
    {
        return modRepositoriesShelvesMapper.selectModRepositoriesShelvesList(modRepositoriesShelves);
    }

    /**
     * 新增
     * 
     * @param modRepositoriesShelves
     * @return 结果
     */
    @Override
    public int insertModRepositoriesShelves(ModRepositoriesShelves modRepositoriesShelves)
    {
        modRepositoriesShelves.setCreateTime(DateUtils.getNowDate());
        return modRepositoriesShelvesMapper.insertModRepositoriesShelves(modRepositoriesShelves);
    }

    /**
     * 修改
     * 
     * @param modRepositoriesShelves
     * @return 结果
     */
    @Override
    public int updateModRepositoriesShelves(ModRepositoriesShelves modRepositoriesShelves)
    {
        modRepositoriesShelves.setUpdateTime(DateUtils.getNowDate());
        return modRepositoriesShelvesMapper.updateModRepositoriesShelves(modRepositoriesShelves);
    }

    /**
     * 批量删除
     * 
     * @param ids 需要删除的主键
     * @return 结果
     */
    @Override
    public int deleteModRepositoriesShelvesByIds(Long[] ids)
    {
        return modRepositoriesShelvesMapper.deleteModRepositoriesShelvesByIds(ids);
    }

    /**
     * 删除信息
     * 
     * @param id 主键
     * @return 结果
     */
    @Override
    public int deleteModRepositoriesShelvesById(Long id)
    {
        return modRepositoriesShelvesMapper.deleteModRepositoriesShelvesById(id);
    }


    /**
     * 批量添加
     */
    public int batchInsertModRepositoriesShelves(List<ModRepositoriesShelves> dataList)
    {
        return modRepositoriesShelvesMapper.batchInsertModRepositoriesShelves(dataList);
    }
}
